﻿using System;
using System.Collections.Generic;
using System.Text;

namespace com.dz.ct.common
{
    public  class BookChapterInfo
    {
        /// <summary>
        /// 小说ID
        /// </summary>
        public string BookId { get; set; }

        /// <summary>
        /// 小说章节ID
        /// </summary>
        public string ChapterId { get; set; }

        /// <summary>
        /// 小说章节名称
        /// </summary>
        public string ChapterName { get; set; }

        /// <summary>
        /// 小说章节地址
        /// </summary>
        public string ChapterUrl { get; set; }

        /// <summary>
        /// 上一章节id
        /// </summary>
        public string PreChapterId { get; set; }

        /// <summary>
        /// 下一章节id
        /// </summary>
        public string NextChapterId { get; set; }


        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 是否vip章节
        /// </summary>
        public bool IsVip { get; set; }

        /// <summary>
        /// 站点id
        /// </summary>
        public int SiteId { get; set; }

        /// <summary>
        /// 排序用
        /// </summary>
        public int SortId { get; set; }

        /// <summary>
        /// 转换
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            string m_t = "#";
            string m_r = "%$";
            return string.Format("{0}{9}{1}{9}{2}{9}{3}{9}{4}{9}{5}{9}{6}{9}{7}{9}{8}{10}",
                BookId, ChapterId, ChapterName.Replace(m_r,"").Replace(m_t,""),  IsVip ? 1 : 0, ChapterUrl, string.IsNullOrEmpty(PreChapterId) ? " " : PreChapterId, string.IsNullOrEmpty(NextChapterId) ? " " : NextChapterId,string.Format("{0}.000", UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")), SiteId, m_t,m_r);
        }
    }
}
